﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Services;

namespace JuSolution.Web.ApiService.App.Toursim
{
    /// <summary>
    /// ContentService 的摘要说明
    /// </summary>
    [WebService(Namespace = "http://tempuri.org/")]
    [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
    [System.ComponentModel.ToolboxItem(false)]
    // 若要允许使用 ASP.NET AJAX 从脚本中调用此 Web 服务，请取消注释以下行。 
    // [System.Web.Script.Services.ScriptService]
    public class ContentService : ExService
    {
        private  JuCloudy.Data.Nhibernate.App.Toursim.ContentContainer container { get; set; }
        [WebMethod]
        public override string Insert(string JsonOfEntity)
        {
            container = new JuCloudy.Data.Nhibernate.App.Toursim.ContentContainer();
            return container.Insert((JuCloudy.Data.Entity.AppToursimContent)
                JsonOfEntity.Deserialize(typeof(JuCloudy.Data.Entity.AppToursimContent))
                ).Serialize();
        }
        [WebMethod]
        public override string Delete(string JsonOfEntity)
        {
            container = new JuCloudy.Data.Nhibernate.App.Toursim.ContentContainer();
            return container.Delete((JuCloudy.Data.Entity.AppToursimContent)
                JsonOfEntity.Deserialize(typeof(JuCloudy.Data.Entity.AppToursimContent))
                ).Serialize();
        }
        [WebMethod]
        public override string GetEntity(string Query)
        {
            container = new JuCloudy.Data.Nhibernate.App.Toursim.ContentContainer();
            return container.GetEntity(Query).Serialize();
        }
        [WebMethod]
        public override string GetEntities()
        {
            container = new JuCloudy.Data.Nhibernate.App.Toursim.ContentContainer();
            return container.GetEntities().Serialize();
        }
    }
}
